import {DEBUG,DEVTOOL,DEVMODE,DEVTOOLDIRECT} from './cons';

import {Provider} from 'react-redux';
import Routes from './router';
import store from 'backbone/store/configureStore';

import { DevTools, DebugPanel, LogMonitor } from 'redux-devtools/lib/react';


export default class Root extends React.Component{
	constructor(){
		super();
		this.state = {};
	}

	render(){
		let debugContainer;
		if(DEBUG&&DEVTOOL){
			debugContainer = (
				<DebugPanel top right bottom>
	        <DevTools store={store} monitor={DEVMODE} />
	      </DebugPanel>
			)
		}else{
			debugContainer = '';
		}
		return (
			<div>
				<Provider store={store}>
					{()=> <Routes /> }
				</Provider>
				{debugContainer}
			</div>
		)
	}
}